<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>yqTextRichBox</title>
    <uieip type="file" value="inc" src="/yqwin/easyui/include.txt" cache="true" minute="1440"></uieip>
    <uieip type="file" value="css" src="/yqwin/css/yqwin.min" cache="false"></uieip>
    <uieip type="file" value="js" src="/yqwin/data/yqwin.min" cache="false"></uieip>
</head>

<body>
    <h1>yqTextRichBox</h1>
    <input id="tb" type="text" style="width:280px;">
    <p></p>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:setValue()">setValue</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:clearRow()">clear</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:getValue()">getValue</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:isEdit(true)">isEdit==true</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:isEdit(false)">isEdit==false</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:destroy()">destroy</a>
    <script>
        $(function () {
            $("#tb").yqTextRichBox({
                value: "sdfsdfsdfsdfsdfdf",
                blank: true,
                min: null,
                max: null,
                isEdit: true,   //可编辑
                editModeW: 400, //模态编辑器宽度 格式为 800（数字）
                editModeH: 300, //模态编辑器高度 格式为 600（数字）
                beforeChange: function (value, callback) {
                    console.log(value);
                    callback(true, value);
                }
            });
        });

        function setValue() {
            $("#tb").yqTextRichBox("setValue", "setValue:" + $.getUniqueID());
        }

        function clearRow() {
            $("#tb").yqTextRichBox("clear");
        }

        function getValue() {
            var val = $("#tb").yqTextRichBox("getValue");
            console.log("getValue", val);
        }

        function isEdit(tf){
            $("#tb").yqTextRichBox("isEdit",tf);
        }

        function destroy(){
            $("#tb").yqTextRichBox("destroy");
        }

    </script>
</body>

</html>